import request from '@/utils/request'

/**
 * 获取角色列表数据
 */
export const getUSerInfoAPI = (params) => {
  return request({
    url: '/sys/role',
    params: params
  })
}

/**
 * 删除功能
 */
export const deleteUSerInfoAPI = (id) => {
  return request({
    method: 'delete',
    url: `/sys/role/${id}`
  })
}

/**
 * 新增功能
 */
export const AddUSerInfoAPI = (data) => {
  return request({
    method: 'post',
    url: '/sys/role',
    data: data
  })
}

/**
 * 获取-角色详情
 */
export const getpeoplefoAPI = (id) => {
  return request({
    url: `/sys/role/${id}`
  })
}

/**
 * todo 修改-角色详情
 * @param {*} id
 * @param {*} data
 * @returns
 */
export const againListAPI = (id, data) => {
  return request({
    method: 'put',
    url: `/sys/role/${id}`,
    data: data
  })
}

/**
 * todo 分配角色
 * @param {*} id
 * @param {*} data
 * @returns
 */
export const SetingListAPI = (data) => {
  return request({
    method: 'put',
    url: '/sys/role/assignPrem',
    data
  })
}
